<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>


    console.log(1);
    new Promise((resolve,reject)=>{
        console.log(2);
        setTimeout(()=>{
            console.log(3)
        },0)
        resolve();
    }).then(()=>{
        console.log(4);
        return new Promise((resolve,reject)=>{
            console.log(5);
            setTimeout(()=>{
                console.log(6)
            },0)
            resolve()
        })
    }).then(()=>{
        console.log(7)
    }).catch(()=>{
        console.log(8)
    })
    console.log(9)





</script>
</html>